from sklearn.naive_bayes import MultinomialNB
from sklearn.datasets import fetch_20newsgroups
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import TfidfVectorizer
news = fetch_20newsgroups()

X_train, X_test, y_train, y_test = train_test_split(news.data, news.target, test_size=0.25)

tf = TfidfVectorizer()

X_train = tf.fit_transform(X_train)

print(tf.get_feature_names())

